/*
 * opencv.hpp
 *
 *  Created on: 7 mai 2012
 *      Author: clement
 */

#ifndef OPENCV_HPP_
#define OPENCV_HPP_

#include <cstring>
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>

using namespace std;

class Opencv
{
// Propiétés
	public :
		static const int RANGE = 10;

	private :
		CvCapture *capture;
		IplImage *image;
		IplImage *hsv;
		IplImage *masque;
		IplConvKernel *noyau;
		int h,s,v;
		string Nom;

// Méthodes
	public :
		Opencv();
		Opencv(string);
		~Opencv();
		void init(string);
		void CreateWindow(string);
		void AfficheCouleur();
		void AfficheHSV();
		void AfficheMasque();
		void AfficheAll();
		void PlaceCouleur(int, int);
		void PlaceHSV(int, int);
		void PlaceMasque(int, int);
		void Place(int, int);
		void Frame();
		void MasqueForme();

	private :
		static void static_mouse(int a, int b, int c, int d, void* ptr)
		{
			static_cast<Opencv*>(ptr)->getMouseColor(a, b, c, d, ptr);
		}
		void getMouseColor(int, int, int, int, void*);
};


#endif /* OPENCV_HPP_ */
